package com.gnerv.battle.boot.module.base.model.bo;

import com.gnerv.battle.boot.module.base.model.entity.Config;
import com.gnerv.battle.boot.common.tools.DateTimeTools;
import lombok.Data;
import org.springframework.beans.BeanUtils;


/**
 * @author Gnerv LiGen
 */
@Data
public class ConfigBO {

    private String ukId;
    private String code;
    private String name;
    private String value;
    private String status;
    private Integer sort;

    public Config toCreateConfig() {
        Config config = new Config();
        BeanUtils.copyProperties(this, config);
        config.setGmtCreate(DateTimeTools.currentTimeMillis());
        config.setGmtModified(DateTimeTools.currentTimeMillis());
        return config;
    }
    public Config toUpdateConfig() {
        Config config = new Config();
        BeanUtils.copyProperties(this, config);
        config.setGmtModified(DateTimeTools.currentTimeMillis());
        return config;
    }
}